package com.example.sunny.pojo.weather

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.android.parcel.Parcelize
import org.litepal.crud.LitePalSupport
import java.util.*

/**
 * this class is the model map of the response to the daily weather
 * @param status:response状态
 * @param result:返回集合
 */
data class DailyResponse(val status:String,val result: Result){
    data class Result(val daily:Daily)


    @Parcelize
    data class Daily(val temperature: List<Temperature>, val skycon: List<Skycon>,
                     @SerializedName("life_index")val lifeIndex:LifeIndex, @SerializedName("air_quality")val airQuality:AQI):LitePalSupport(),Parcelable

    /**
     * @param max:最高气温
     * @param min:最低气温
     */
    @Parcelize
    data class Temperature(val max:Float,val min:Float):LitePalSupport(),Parcelable

    /**
     * @param date:日期
     * @param value: 天气
     */

    @Parcelize
    data class Skycon(val date:Date,val value:String):LitePalSupport(),Parcelable

    /**
     * @param coldRisk:感冒风险
     * @param carWashing:洗车
     * @param ultraviolet:紫外线
     * @param dressing:穿衣指数
     */
    @Parcelize
    data class LifeIndex(val coldRisk:List<ColdRisk>,val carWashing:List<CarWashing>
    ,val ultraviolet:List<Ultraviolet>,val dressing:List<Dressing>):LitePalSupport(),Parcelable

    /**
     * @param desc:描述
     */

    @Parcelize
    data class ColdRisk(val desc: String):LitePalSupport(),Parcelable

    @Parcelize
    data class CarWashing(val desc: String):LitePalSupport(),Parcelable

    @Parcelize
    data class Ultraviolet(val desc:String):LitePalSupport(),Parcelable

    @Parcelize
    data class Dressing(val desc: String):LitePalSupport(),Parcelable

    @Parcelize
    data class AQI(val aqi:List<AvgAQI>):LitePalSupport(),Parcelable
    @Parcelize
    data class AvgAQI(val avg:Standard):LitePalSupport(),Parcelable
    @Parcelize
    data class Standard(val chn:Float):LitePalSupport(),Parcelable
}
